Ultimate Laravel for Modern Web Development: Build Robust and Interactive Enterprise-Grade Web Apps Using Laravel's MVC, Authentication, APIs, and Cloud Deployment (English Edition) by Jain Drishti;

Ultimate Laravel for Modern Web Development: Build Robust and Interactive Enterprise-Grade Web Apps Using Laravel's MVC, Authentication, APIs, and Cloud Deployment (English Edition) by Jain Drishti;

Author:Jain, Drishti; [Jain, Drishti]
Language: eng
Format: epub
Publisher: Orange Education PVT Ltd
Published: 2024-10-15T00:00:00+00:00


HTTP Authentication

HTTP Authentication allows you to quickly authenticate users of your application without having to build up a separate “login” page. Attach the auth.basic middleware to a route to get started. You do not need to define the auth.basic middleware because it is available with the Laravel framework.

Route::get(‘/profile’, function () {

// Only authenticated users may access this route

})->middleware(‘auth.basic’);

When you access the route in your browser once the middleware has been attached, you will be requested for credentials. The auth.basic middleware will presume that the email field in your users database table is the user’s “username” by default.

HTTP Basic authentication may fail if you use PHP FastCGI and Apache to serve your Laravel application. To resolve these issues, add the following lines to your application’s .htaccess file:

RewriteCond %{HTTP:Authorization} ^(.+)$

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.